package com.example.kliven.because.imagecache;import android.graphics.Bitmap;import com.android.volley.toolbox.ImageLoader;/** * Created by Kliven on 16/1/18. * <p> * 控制内存缓存、硬盘缓存顺序； */public class DoubleCache implements ImageLoader.ImageCache {    private MemoryCache memoryCache;    private DishCache dishCache;    public DoubleCache() {        memoryCache = new MemoryCache();        dishCache = new DishCache();    }    @Override    public Bitmap getBitmap(String url) {        Bitmap bitmap = memoryCache.getBitmap(url);        if (null == bitmap) {            bitmap = memoryCache.getBitmap(url);        }        return bitmap;    }    @Override    public void putBitmap(String url, Bitmap bitmap) {        memoryCache.putBitmap(url, bitmap);        dishCache.putBitmap(url, bitmap);    }}